<?php
/***************************************************************************
 * 
 * Copyright (c) 2010 , Inc. All Rights Reserved
 * $Id$:TestView.php,2010/05/25 18:01:34 
 * 
 **************************************************************************/
 
 
 
/**
 * @file TestView.php
 * @author huqingping(huqingping@)
 * @date 2010/05/25 18:01:34
 * @version 1.0 
 * @brief 
 *  
 **/

final class TestView extends TestCase
{
	function testView()
	{
		$ret = $this->fetch('/HapN/testView',array());
		$this->assertTrue(strpos($ret->body,'<html>') !== false);
	}

	function testViewParams()
	{
		$get = array('k1'=>'kk','k2'=>'cc');
		$post = array('k3'=>'dd','k4'=>'ee');
		$ret = $this->fetch('/HapN/testView',array('get'=>$get,'post'=>$post));
		$this->assertTrue(strpos($ret->body,'<html>') !== false);
		$this->assertTrue(strpos($ret->body,'k1=kk') !== false);
		$this->assertTrue(strpos($ret->body,'k2=cc') !== false);
		$this->assertTrue(strpos($ret->body,'k3=dd') !== false);
		$this->assertTrue(strpos($ret->body,'k4=ee') !== false);
	}

	function testViewFunc()
	{
		$ret = $this->fetch('/HapN/testView',array());
		$this->assertTrue(strpos($ret->body,'<html>') !== false);
		$this->assertTrue(strpos($ret->body,'encid=') !== false);
		$this->assertTrue(strpos($ret->body,'enc2id=') !== false);
		$this->assertTrue(strpos($ret->body,"data=") !== false);
		$this->assertTrue(strpos($ret->body,'trunc=') !== false);
		$this->assertTrue(strpos($ret->body,'gbk2jsunicode=') !== false);
	}
}






/* vim: set ts=4 sw=4 sts=4 tw=100 noet: */
?>
